package com.dunqi.gpm.cangxi.home.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;

import com.dunqi.gpm.cangxi.R;
import com.dunqi.gpm.cangxi.common.base.BaseAct;
import com.dunqi.gpm.cangxi.home.adapter.ViewPagerFragmentAdapter;
import com.dunqi.gpm.cangxi.home.bean.Project;
import com.dunqi.gpm.cangxi.home.constance.Constance;

import java.util.ArrayList;

import butterknife.BindView;

public class QuestionListActivity extends BaseAct {

    String[] titles = {"项目问题", "问题协调记录"};
    @BindView(R.id.tab_layout)
    TabLayout tabLayout;
    @BindView(R.id.view_pager)
    ViewPager viewPager;
    ArrayList<Fragment> fragments = new ArrayList<>();

    @Override
    protected void refreshData(Bundle savedInstanceState) {

    }

    @Override
    protected void initUiAndListener() {

        viewPager.setAdapter(new ViewPagerFragmentAdapter(getSupportFragmentManager(),fragments,titles));
        tabLayout.setupWithViewPager(viewPager);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_question_list;
    }

    public static void start(Context context, Project project) {
        Intent intent = new Intent(context, QuestionListActivity.class);
        intent.putExtra(Constance.PROJECT, project);
        context.startActivity(intent);
    }

}
